<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>签到异常监控</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css">
</head>
	<style type="text/css">
        body{
            text-align: center;
        }
		.layuicontain{
			padding: 50px;
            text-align: center;
		}
        .grid-demo-bg1{

		}
		@media screen and (min-width:992px) {
			.layuicontain{
				width: 500px;
			    margin: 0 auto;
			}
		}

	</style>
<body>
    <div class="layuicontain">
        <h1>签到异常监控</h1><br><br><br><br><br>
        <div class="layui-row">
            <div class="layui-col-xs12 ">
                <div class="grid-demo grid-demo-bg1">
                    <form class="layui-form layui-form-pane" action="">
                        <div class="layui-form-item">
                            <label class="layui-form-label">用户名</label>
                            <div class="layui-input-block">
                              <input type="text" name="user" required  lay-verify="required" placeholder="请输入正确的oa用户名" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">密码</label>
                            <div class="layui-input-block">
                                <input type="password" name="password" required lay-verify="required" placeholder="请输入正确的oa密码" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">邮箱</label>
                            <div class="layui-input-block">
                              <input type="text" name="email" required  lay-verify="email" placeholder="请输入接收提醒邮件邮箱" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">

                            <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                            <br>
                            <br>
                            <br>
                            <p>系统功能：每天早上8:10分获取OA系统签到信息，如有缺勤、迟到、早退状况发送邮件至用户提交邮箱提醒。</p>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <script src="/static/jquery/jquery.min.js"></script>
    <script src="/static/layui/layui.js"></script>
    <script>
        layui.use('form', function(){
            var form = layui.form;
          //监听提交
            form.on('submit(formDemo)', function(data){
                console.log(data);
{#                layer.msg(JSON.stringify(data.field));#}
                $.ajax({
                    type: "post",
                    url: "/zhuce/zhuce_user/",
                    data: data.field,
                    dataType: "json",
                    success: function (data) {
                        if (data.code === 0) {
                            layer.alert('新增用户成功！', {end: function () {
                                location.reload()
                            }});
                        } else if(data.code === 1){
                            layer.alert('新增用户失败！请重试！！！',{end: function () {
                                location.reload()
                            }})
                        } else if (data.code === 2){
                            layer.alert('新增用户失败！用户名已存在！！！',{end: function () {
                                location.reload()
                            }})
                        } else {
                            var m = data.msg;
                            console.log(typeof(m));
                            layer.alert(m, {end: function () {
                                    location.reload()
                                }
                            })
                        }
                    }
                });
                return false;
            });
        });

    </script>
    <div>
        <i class="layui-icon layui-icon-face-smile" style="font-size: 30px; color: #1E9FFF;"></i>
        &nbsp;&nbsp;<p style='display: inline;'>省下每日检查时间，全心全力投入工作</p>
        &nbsp;&nbsp;<i class="layui-icon layui-icon-face-smile" style="font-size: 30px; color: #1E9FFF;"></i>
    </div>
</body>
</html>